"""
    requests模块示例
    向京东首页发请求,获取京东首页响应内容
"""

import requests

resp = requests.get(url="http://127.0.0.1:7000/dadashop/templates/index.html",
                    headers={"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20100101 Firefox/6.0"})

print(resp.content.decode("utf-8", "ignore"))

# 响应对象：resp
# resp.text 属性：获取响应内容-string
# resp.content 属性：获取响应内容-bytes
# resp.status_code 属性：http响应码
















